/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
// pcapture.hpp - PegCapture definition
//
// Author: Kenneth G. Maxwell
//         Jim DeLisle
//
// Copyright (c) 1997-2004 Swell Software 
//              All Rights Reserved.
//
// Unauthorized redistribution of this source code, in whole or part,
// without the express written permission of Swell Software
// is strictly prohibited.
//
// Notes:
// 
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/

#ifndef _PEGCAPTURE_
#define _PEGCAPTURE_

class PegCapture
{
    public:
        PegCapture(void)
        {
            mRect.Set(0, 0, 0, 0);
            mBitmap.pStart = 0;
            mValid = FALSE;
            mDataSize = 0;
        }

        ~PegCapture()
        {
            if (mBitmap.pStart)
            {
                delete mBitmap.pStart;
            }
        }

        PegRect &Pos(void) {return mRect;}
        PegPoint Point(void);
        PEGLONG  DataSize(void) {return mDataSize;}

        void SetPos(PegRect &Rect)
        {
            mRect = Rect;
            mBitmap.Width = (PEGUSHORT) Rect.Width();
            mBitmap.Height = (PEGUSHORT) Rect.Height();
        }

        PEGBOOL IsValid(void) const {return mValid;}
        void SetValid(PEGBOOL Valid) {mValid = Valid;}
        void Realloc(PEGLONG Size);
        void Reset(void);
        void MoveTo(PEGINT Left, PEGINT Top);
        void Shift(PEGINT xShift, PEGINT yShift) {mRect.Shift(xShift, yShift);}
        PegBitmap *Bitmap(void) {return &mBitmap;}

    private:

        PegRect mRect;
        PegBitmap mBitmap;
        PEGLONG    mDataSize;
        PEGBOOL    mValid;
};

#endif

